package cc.geguol.iodemo.randomaccessdemo;

import java.io.IOException;
import java.util.concurrent.CountDownLatch;

/**
 * 作者：13687
 * 日期：2017/6/18
 * 项目：IODemo
 * 描述：每个现场需要做的事都是一样的吧
 */
public abstract class BaseRunnable implements Runnable {
	public BaseRunnable(CountDownLatch countDownLatch) {
		this.countDownLatch = countDownLatch;
	}

	protected boolean booleanResult = false;// 最后操作结果

	private CountDownLatch countDownLatch;
	@Override
	public void run() {
		try {
			verfery();
			booleanResult = true;
		}catch (IOException e){
			e.printStackTrace();
			booleanResult = false;
			// 线程结束
		}
		countDownLatch.countDown();
	}

	abstract void verfery() throws IOException;
}
